﻿using Microsoft.VisualBasic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Text.Json.Serialization;
using WcMatch.Utility;

namespace WcMatch.Models
{
    public class StuResume
    {
        public string? CitizenId { get; set; }

        public string? Name   { get; set; }

        public string? CompanyName { get; set; }

        public string? CompanyId { get; set;}

        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? BeginTime { get; set; }

        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? EndTime { get; set; }

        public string? Job { get; set; } 

        public int? Salary { get; set; }
        
        //当前工作状态：在职/离职
        public string? CurrentJobStatus { get; set; }

        //最后更新时间
        [JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? UpdateTime { get; set; }

        public string? Others { get;set; }

        public int? EmploymentType { get;set; }


        //每段履历的ID，通过每段履历的ID维护当前履历
        [Key]
        public string ResumeId { get; set; }

        public StuResume() 
        {
            BeginTime = DateTime.Today;
            EndTime = DateTime.Today;
            UpdateTime = DateTime.Today;
            ResumeId = Guid.NewGuid().ToString();
        }

        public StuResume(string cId)
        {
            CitizenId = cId;
            BeginTime = DateTime.Today;
            EndTime = DateTime.Today;
            UpdateTime = DateTime.Today;
            ResumeId = Guid.NewGuid().ToString();
        }
    }
}
